<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>vue filter demo</title>
        <script src="../../lib/vue-dev/dist/vue.min.js"></script>
    </head>

    <body>
        <div id="app">
            <p>{{ msg | testFilterFormat('疯狂') }}</p>
        </div>

        <script>
            Vue.filter('testFilterFormat', function(data, arg){
              return data.replace(/单纯/g, arg);  
            });
            var vm = new Vue({
                el: '#app',
                data: {
                    msg: '曾经我也是个单纯的好人。'
                },
                methods: {
                }
            });
        </script>
    </body>

</html>